package com.yw.accountInfo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 人员管理表
 * @TableName account_info
 */
//@Schema(description = "人员实体")
@TableName(value ="account_info")
@Data
public class AccountInfo implements Serializable {
    /**
     * 主键
     */
    @Schema(name = "id", description = "主键")
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 用户账号
     */
    @Schema(name = "account", description = "用户账号")
    private String account;

    /**
     * 用户姓名
     */
    @Schema(name = "accName", description = "用户姓名")
    private String accName;

    /**
     * 用户密码，默认手机号后6位
     */
    @Schema(name = "password", description = "用户密码，默认手机号后6位")
    private String password;

    /**
     * 手机号11位
     */
    @Schema(name = "accPhone", description = "手机号11位")
    private String accPhone;

    /**
     * 是否启用(1:启用，0:停用)
     */
    @Schema(name = "isEnable", description = "是否启用(1:启用，0:停用)")
    private Integer isEnable;

    /**
     * 创建时间
     */
    @Schema(name = "createTime", description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(name = "updateTime", description = "更新时间")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AccountInfo other = (AccountInfo) that;
        return (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount()))
                && (this.getAccName() == null ? other.getAccName() == null : this.getAccName().equals(other.getAccName()))
                && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
                && (this.getAccPhone() == null ? other.getAccPhone() == null : this.getAccPhone().equals(other.getAccPhone()))
                && (this.getIsEnable() == null ? other.getIsEnable() == null : this.getIsEnable().equals(other.getIsEnable()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());
        result = prime * result + ((getAccName() == null) ? 0 : getAccName().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getAccPhone() == null) ? 0 : getAccPhone().hashCode());
        result = prime * result + ((getIsEnable() == null) ? 0 : getIsEnable().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", account=").append(account);
        sb.append(", accName=").append(accName);
        sb.append(", password=").append(password);
        sb.append(", accPhone=").append(accPhone);
        sb.append(", isEnable=").append(isEnable);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
